package org.csu.mypetstore.api.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    /* *
     *类名：AlipayConfig
     *功能：基础配置类
     *详细：设置帐户有关信息及返回路径
     *修改日期：2017-04-05
     *说明：
     *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
     *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
     */

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

        // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
        public static String app_id = "2021000117632552";
        // 商户私钥，您的PKCS8格式RSA2私钥
        public static String merchant_private_key = "MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQCdLHla+XR/a4iZTrMD3NYDkxzie019FplwSR4kXJBmRFVLjhp6KOpyS34k8G7TmF0AEgdvIC2rU6ae9cG8aSput7IFyzJNgGPp+KBr6CkylOu1c7GGNoefBIUw+cibM2n4N3b8XuRJCGVmVQN5d/pdzdd3ownwRY/trQOVi1ySvtjg2fVntupiTmuJLH54CThE2HNo2Hk4uKr3W/o+If8GoDdlAh/Me73qSZhHf3eR9LifDbXdtRmmq0a6aQ/2Ao6tgsT401SlU+AlkB1H+OPZlfb/TiAx7TBNLAw8IYPqYDuXEvEMtzFiG0sap8PlsHmAjQ0N95MD8zZ++RtfW4kpAgMBAAECggEBAIB+2pv4szh05pFHmO0Af2seu4+hdMFeV4VIEb9yeY9SMFV70MOsbbeRZoi2lDSjLO0g0DkWmp+l3OO6UXBCnjE0NvOrou1fmM+wtx5hCEVVILsQ4cKzE/96R5W5sDrKNsl6Numufn4Cwjt+J0AISYSlA5HIlhh8FmYee36oF7/TxJt0I13+6JEDEhEPYP5pR35UcVqcCVqk2KttJmSrnYIUVrbbnzjWNUMrBG0il9DKP4vefGcVgeIPSqvtnn/GwR9BSKzmLvfRO5Vt8mQqjdwSSjQUS3V434lQ3LN7zHcgPf+5fn1Hi035GaPAePBAQ7qL0qrTg8Hw+HKrcKOJ2m0CgYEA1JVKO2erciz8dxXolpDk9suWWhzdzJVqSsbYZpWf0Qkno1aHBtLUVFpcCqN9dlUavFLFL4XFeYl0mKrtV6Vl4VGF8MTZ5qyA5QYvKduqObEvKG5EWW7zppYT86p7P/2xo4yqERvXo/Glcd/c9382dVwX9cn6iLK6TgFbcEgqMVMCgYEAvUYnahBRPDACPQ5VNOublO7F8H9NcZVeJ+wuFIzZQzEH8p8jQPlv2AXWfyODYi5quT90SPyRItPjw5HoHvpKp2V3F+CrtOV/B5vskIv539N1Lrx3vny8mDmeDTluWA34v2vIY/yPYAC+g5vXmt0ILj4ArwQpxOGeiMBChZpCoBMCgYEAnb3hhU8Z4vEKrXruSbteitrqyBcfZg2A/9epAAYKvtviM8ujCicrMySRo7tI/6OK4S8x7l9+9v5OLHK5Bw5OGPGbR9tqLUbXphn+qTq8h264pXGc+hfgaD54s5hPOF6Rj+By2ZslWhuXPnZ0ypn02QTrKpEjfIfSwsszBJAn7s0CgYEAiifUC0Jf2Xv9lk2I+njj9qEXUIXLpJXvxVpLBGsPB1GZyIpKdFnePqN8Pw9QDnFtK0za94+L7Q0XWqB8+2ec6HVSqdYv33oI8CfrVFMoEC3MglHFYgCwtLiR2ntKRPHl2Ou2uO0YRm4kofI2PW8LUp2laBq01mYNjyovJFBGQ4sCgYEAg1DhGJNyyq/03ApW6Ir7xvYtQz6O4RlgxCAg9CwSKM9SWPPYnGpF72GVIc2CJlrHO8Vr9tk9OfM3KMWObi+KnEIEE1QgWXxdi4ICpp6VINdPqbhyYCMBmMYdUxKUO24K2M8ryE6Cni374v6R0EvCeEEfJvpzgZJemIZ2miD107k=";
        // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.html 对应APPID下的支付宝公钥。
       public static String alipay_public_key ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArXAOOa7GHr4xvy3tnNkc1SbAFUNkyElI8jQ9t/D3HY8jaw+kga0NKjBNXcXwwdq7ZFgWYgRIU7tHSFDtgL+/tkBqcuS0vqXcNH9pYaw0a+8nbyOytHFsbI7XmaXZlo6xMz4hKKhlJodN5LF1BhycXIBhCpNb3e3gviDyVpibF6Kmax+8lYsSPDzi5Qovcqz8FpaRn9SgWKtsDtaAd1R/R/+njrpMyaLoBSazK5GgOctMQczCU7px7T5wyLhVZ5vwcCb5OjBr55r2cLusUwps2H1UBVEXiB8C9XAGzhAq+a+TWjIm4uiVq1Elq/CA1My43snCpVkeneTVYzSaDioIDQIDAQAB";
       // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
        public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

        // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
        public static String return_url = "http://localhost:8080/#/pay";

        // 签名方式
        public static String sign_type = "RSA2";

        // 字符编码格式
        public static String charset = "UTF-8";

        // 支付宝网关
        public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

        // 支付宝网关
        public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

        /**
         * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
         * @param sWord 要写入日志里的文本内容
         */
        public static void logResult(String sWord) {
            FileWriter writer = null;
            try {
                writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
                writer.write(sWord);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                if (writer != null) {
                    try {
                        writer.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    }



